package com.xxchat.entity.enums;

import lombok.Getter;

@Getter
public enum GroupActionEnum {
    ADD(0, "添加成员"),
    REMOVE(1, "移除成员");

    private final Integer action;
    private final String desc;

    GroupActionEnum(Integer action, String desc) {
        this.action = action;
        this.desc = desc;
    }

    public static GroupActionEnum getByAction(Integer action) {
        for (GroupActionEnum groupActionEnum : GroupActionEnum.values()) {
            if (groupActionEnum.getAction().equals(action)) {
                return groupActionEnum;
            }
        }
        return null;
    }
}
